#ifndef BSP_INTERFACE_H__
#define BSP_INTERFACE_H__

#include <stdint.h>

#include "los_mux.h"

#define LOS_MUX     uint32_t;

typedef struct
{
    uint64_t lastUpdatedTick;
    int value;
}SensorIntData_t;

typedef struct
{
    uint64_t lastUpdatedTick;
    float value;
}SensorFloatData_t;

typedef struct
{
    
}CNTL_GPIO_Data_t;

//IIC基础设施
typedef struct
{
    
}HW_I2C_Base_t;

typedef struct
{
    uint8_t connectError;   //连接状态
    
    int (*init)(void);
    int (*deinit)(void);


}HW_;

// typedef struct
// {
//     uint8_t connectError;   //连接状态
    
//     int (*init)(void);
//     int (*deinit)(void);

//     //data
    
//     SensorFloatData_t temper, humid, lumi;
    
//     uint64_t lastChangedTick;   //最后一次改变的时间
//     int motor, light;
//     //func
//     int (*update_e53_data)(void);

//     int (*cntl_motor)(state)

// }HW_e53_t;

typedef struct
{
    HW_Base_t base;

    struct{
        uint16_t duty;
        uint16_t freq_hz;
        uint8_t channel;
        // volatile uint32_t isr_count; // PWM中断计数
    } config;

}HW_PWMDev_t;

//adc 烟雾传感器、空气质量传感器
typedef struct
{
    HW_Device_t base;
    BaseIntData_t rawData;
    int changed data;

    int (*update_data)(void *arg);
}HW_adcDev_t;

//门禁控制(暂时用pwm控制舵机实现)
typedef struct
{
    BaseCntlData_t gate;    //开、关

    int (*cntl_gate)(void* arg);
    int (*nfc_cntl)(void* arg); //NFC开锁
    int (*faceRecognize_cntl)(void *arg);   //人脸识别接口
}HW_gate_t;

//NFC模块（刷卡开锁）
// typedef struct
// {
    
// }

#endif
